package com.example.demo.service;

import com.example.demo.model.*;
import org.springframework.web.multipart.MultipartFile;

import javax.annotation.Resource;
import javax.servlet.http.HttpServletRequest;
import java.io.IOException;
import java.io.UnsupportedEncodingException;
import java.security.NoSuchAlgorithmException;

public interface AdminService {
    /*添加类型*/
    public ResponseBo addType(TYPE type);

    /*删除类型*/
    public ResponseBo delType(int typeid);

    /*更新类型*/
    public ResponseBo updateType(TYPE type);

    /*获取类型*/
    public ResponseBo getTypes();

    /*根据归属获取类型*/
    public ResponseBo getTypeByBelong(int belong);

    /*获取类型归属*/
    public ResponseBo getBelongs();

    /*添加类型归属*/
    public ResponseBo addBelong(BELONG belong);

    /*删除类型归属*/
    public ResponseBo delBelong(int belid);

    /*更新类型归属*/
    public ResponseBo updateBelong(BELONG belong);

    /*获取全部文本*/
    public ResponseBo getTexts() throws IOException;

    /*添加文本*/
    public ResponseBo addText(TEXT text, MultipartFile file) throws IOException;

    /*删除文本*/
    public ResponseBo delText(int textid);

    /*更新文本*/
    public ResponseBo updateText(TEXT text,MultipartFile file);

    /*获取全部留言*/
    public ResponseBo getMessages();

    /*添加留言*/
    public ResponseBo addMessage(MESSAGE message);

    /*删除留言*/
    public ResponseBo delMessage(int mesid);

    /*登录*/
    public ResponseBo login(USER user, HttpServletRequest request) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /*注销*/
    public ResponseBo logout(HttpServletRequest request);

    /*获取全部用户*/
    public ResponseBo getUsers();

    /*根据id获取用户*/
    public ResponseBo getUserById(int userid);

    /*删除用户*/
    public ResponseBo delUser(int userid);

    /*添加用户*/
    public ResponseBo addUser(USER user) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /*更新用户*/
    public ResponseBo updateUser(USER user);

    /*修改用户密码*/
    public ResponseBo updateUserPass(USER user) throws UnsupportedEncodingException, NoSuchAlgorithmException;

    /*获取合作公司*/
    public ResponseBo getCoops() throws IOException;

    /*删除合作公司*/
    public ResponseBo delCoop(int coopid);

    /*更新合作公司*/
    public ResponseBo updateCoop(COOPCOMPANY coopcompany,MultipartFile file,int userid);

    /*添加合作公司*/
    public ResponseBo addCoop(COOPCOMPANY coopcompany, MultipartFile file,int userid) throws IOException;

    /*获取招聘信息*/
    public ResponseBo getAdvs();

    /*删除招聘信息*/
    public ResponseBo delAdv(int advid);

    /*添加招聘信息*/
    public ResponseBo addAdv(ADVERTISE advertise);

    /*更新招聘信息*/
    public ResponseBo updateAdv(ADVERTISE advertise);
}
